<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<meta charset="utf-8" name="viewport" content="width=device-width,initial-scale=1.0">
	<script type="text/javascript" src="myiscroll.js"></script>
	<!-- 功能弱性能高 -->
	<style type="text/css">
		.wrap{
	width: 250px;height: 400px;background: #ccc;overflow: hidden;margin: 50px;
		}
		.content{
	width: 500px;height: 1000px;background: -webkit-linear-gradient(left top,red,green);
		}
	</style>
</head>
<body>
	<div class="wrap">
		<div class="content">
			
		</div>
	</div>
	<script type="text/javascript">
		window.onload=function(){
			let isc=new Myscroll('.wrap',{scrollX:true,freeScroll:true});
			console.log(isc.options)
			isc.beforeScrollStart(function(){
				console.log('beforeScrollStart');
			})
			isc.on('beforeScrollStart',function(){
				console.log('beforeScrollStart2');
			})
			isc.on('scrollStart',function(){
				console.log('scrollStart');
			})
			isc.on('scroll',function(){
				console.log('scroll',isc.x,isc.y);
			})
			isc.on('scrollEnd',function(){
				console.log('scrollEnd');
			})
		}
	</script>
</body>
</html>